package cn.gzjp.modules.it.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.gzjp.common.persistence.Page;
import cn.gzjp.common.service.CrudService;
import cn.gzjp.modules.it.entity.Car;
import cn.gzjp.modules.it.entity.PlateData;
import cn.gzjp.modules.it.dao.PlateDataDao;

/**
 * 车牌数据Service
 * @author zengcp
 * @version 2018-01-30
 */
@Service
@Transactional(readOnly = true)
public class PlateDataService extends CrudService<PlateDataDao, PlateData> {

	public PlateData get(String id) {
		return super.get(id);
	}
	
	public List<PlateData> findList(PlateData plateData) {
		return super.findList(plateData);
	}
	
	public Page<PlateData> findPage(Page<PlateData> page, PlateData plateData) {
		return super.findPage(page, plateData);
	}
	
	@Transactional(readOnly = false)
	public void save(PlateData plateData) {
		PlateData m = get(plateData.getId());
		if(m!=null){
			super.save(plateData);
		}else{
			super.insert(plateData, plateData.getId());
		}
	}
	
	@Transactional(readOnly = false)
	public void delete(PlateData plateData) {
		super.deleteByLogic(plateData);
	}
	
}